/*
 * @Author: guandeshen 295570679@qq.com
 * @Date: 2024-05-19 12:23:55
 * @LastEditors: guandeshen 295570679@qq.com
 * @LastEditTime: 2024-09-02 17:48:04
 * @FilePath: /task-admin/src/api/project/index.ts
 * @Description:
 *
 * Copyright (c) 2024 by ${git_name_email}, All Rights Reserved.
 */
import request from "@/utils/request";
import {
  ProjectList,
  ProjectQuery,
  ProjectForm,
  detailQuery,
  ToolDelForm,
  UserDelForm,
  ExportForm,
} from "./model";
class ProjectAPI {
  /**
   * 获取项目分页列表
   *
   * @data data
   */
  static getPage(data: ProjectQuery) {
    return request<any, PageResult<ProjectList[]>>({
      url: "/tenant/project/index",
      method: "post",
      data: data,
    });
  }

  /**
   * 添加编辑项目
   *
   * @data data
   */

  static add(data: ProjectForm) {
    return request({
      url: "/tenant/project/edit",
      method: "post",
      data: data,
    });
  }

  /**
   * 删除项目
   *
   * @data data
   */
  static deleteByIds(data: Ids) {
    return request({
      url: "/tenant/project/del",
      method: "post",
      data: data,
    });
  }

  /**
   * 删除工具
   *
   * @data data
   */
  static deleteToolsByIds(data: ToolDelForm) {
    return request({
      url: "/tenant/wbs/deltool",
      method: "post",
      data: data,
    });
  }

  /**
   * 删除工具
   *
   * @data data
   */
  static deleteUserByIds(data: UserDelForm) {
    return request({
      url: "/tenant/wbs/deluser",
      method: "post",
      data: data,
    });
  }

  /**
   * 详情
   *
   * @data data
   */

  static detail(data: detailQuery) {
    return request<any, ProjectForm>({
      url: "/tenant/project/detail",
      method: "post",
      data: data,
    });
  }

  /**
   * 导出预算清单
   *
   * @data data
   */

  static bdgexport(data: ExportForm) {
    return request<any, any>({
      url: "/tenant/project/bdgexport",
      method: "post",
      data: data,
    });
  }
}

export default ProjectAPI;
